home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 6: Level 6 / 17 Bit - Level 6 (1998)(Epic Marketing)[!].iso / quartz / q1082.dms / q1082.adf / src.lzh / Fig / break.c < prev    next >
C/C++ Source or Header  |  1991-07-18  |  1KB  |  66 lines

  1. /* 
  2.  *    FIG : Facility for Interactive Generation of figures
  3.  *
  4.  *    Copyright (c) 1985 by Supoj Sutanthavibul (supoj@sally.UTEXAS.EDU)
  5.  *    January 1985.
  6.  *    1st revision : Aug 1985.
  7.  *
  8.  *    %W%    %G%
  9. */
  10. #include "fig.h"
  11. #include "resources.h"
  12. #include "func.h"
  13. #include "object.h"
  14. #include "paintop.h"
  15.  
  16. #define            TOLERANCE    7
  17.  
  18.             init_break();
  19.  
  20. break_selected()
  21. {
  22.     extern    (*canvas_kbd_proc)();
  23.     extern    (*canvas_locmove_proc)();
  24.     extern    (*canvas_leftbut_proc)();
  25.     extern    (*canvas_middlebut_proc)();
  26.     extern    (*canvas_rightbut_proc)();
  27.     extern    null_proc();
  28.     extern    set_popupmenu();
  29.  
  30.     canvas_kbd_proc = null_proc;
  31.     canvas_locmove_proc = null_proc;
  32.     canvas_leftbut_proc = init_break;
  33.     canvas_middlebut_proc = null_proc;
  34.     canvas_rightbut_proc = set_popupmenu;
  35.     set_cursor(&pick15_cursor);
  36.     }
  37.  
  38. init_break(x, y)
  39. int    x, y;
  40. {
  41.     extern F_compound    *compound_search();
  42.     extern F_compound    objects, saved_objects;
  43.     extern int        compoundbox_shown;
  44.     F_compound    *c;
  45.  
  46.     if ((c = compound_search(x, y, TOLERANCE, &x, &y)) == NULL) return;
  47.     clean_up();
  48.     if (compoundbox_shown) draw_compoundbox(c, INV_PAINT);
  49.     delete_compound(&objects.compounds, c);
  50.     break_compound(c);
  51.     set_action(F_BREAK);
  52.     saved_objects.compounds = c;
  53.     break_selected();
  54.     }
  55.  
  56. break_compound(c)
  57. F_compound    *c;
  58. {
  59.     extern F_compound    objects, object_tails;
  60.     extern int        pointmarker_shown;
  61.  
  62.     if (pointmarker_shown) toggle_compoundpointmarker(c);
  63.     tail(&objects, &object_tails);
  64.     append_objects(&objects, c, &object_tails);
  65.     }
  66.